package com.jy.adscm.zltx.bean;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 图纸附件表
 * </p>
 *
 * @author yyy
 * @since 2018-11-06
 */
public class JyDrawingAnnex implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private Long drawingId;
    private String annexPath;

    @TableField(exist = false)
    private String annexName;
    private Integer annexType;//附件类型


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDrawingId() {
        return drawingId;
    }

    public void setDrawingId(Long drawingId) {
        this.drawingId = drawingId;
    }

    public String getAnnexPath() {
        return annexPath;
    }

    public void setAnnexPath(String annexPath) {
        this.annexPath = annexPath;
    }

    public Integer getAnnexType() {
        return annexType;
    }

    public void setAnnexType(Integer annexType) {
        this.annexType = annexType;
    }

    public String getAnnexName() {

        if(this.annexPath !=  null && !"".equals(this.annexPath)){
            annexName =  this.annexPath.substring(this.annexPath.lastIndexOf("\\") + 1);
        }
        return annexName;
    }

    public void setAnnexName(String annexName) {
        this.annexName = annexName;
    }
}
